# eric7.Tools.UIPreviewer

Module implementing the UI Previewer main window.

### Global Attributes

None

### Classes

UIPreviewer | Class implementing the UI Previewer main window.

### Functions

None

## UIPreviewer

Class implementing the UI Previewer main window.

### Derived from

EricMainWindow

### Class Attributes

None

### Class Methods

None

### Methods

UIPreviewer | Constructor
__about | Private slot to show the about information.
__aboutQt | Private slot to show info about Qt.
__copyImageToClipboard | Private slot to handle the Copy Image menu action.
__guiStyleSelected | Private slot to handle the selection of a GUI style.
__handleCloseEvent | Private slot to handle the close event of a viewed QMainWidget.
__initActions | Private method to define the user interface actions.
__initMenus | Private method to create the menus.
__initToolbars | Private method to create the toolbars.
__loadFile | Private slot to load a ui file.
__openFile | Private slot to load a new file.
__print | Private slot to the actual printing.
__printImage | Private slot to handle the Print Image menu action.
__printPreviewImage | Private slot to handle the Print Preview menu action.
__saveImage | Private slot to handle the Save Image menu action.
__updateActions | Private slot to update the actions state.
__updateChildren | Private slot to change the style of the show UI.
__whatsThis | Private slot called in to enter Whats This mode.
eventFilter | Public method called to filter an event.
show | Public slot to show this dialog.

### Static Methods

None

#### UIPreviewer (Constructor)

UIPreviewer(filename=None, parent=None, name=None)

Constructor

filename (str)
  name of a UI file to load
parent (QWidget)
  parent widget of this window
name (str)
  name of this window

#### UIPreviewer.__about

__about()

Private slot to show the about information.

#### UIPreviewer.__aboutQt

__aboutQt()

Private slot to show info about Qt.

#### UIPreviewer.__copyImageToClipboard

__copyImageToClipboard()

Private slot to handle the Copy Image menu action.

#### UIPreviewer.__guiStyleSelected

__guiStyleSelected(index)

Private slot to handle the selection of a GUI style.

index (int)
  index of the selected entry

#### UIPreviewer.__handleCloseEvent

__handleCloseEvent()

Private slot to handle the close event of a viewed QMainWidget.

#### UIPreviewer.__initActions

__initActions()

Private method to define the user interface actions.

#### UIPreviewer.__initMenus

__initMenus()

Private method to create the menus.

#### UIPreviewer.__initToolbars

__initToolbars()

Private method to create the toolbars.

#### UIPreviewer.__loadFile

__loadFile(fn)

Private slot to load a ui file.

fn (str)
  name of the ui file to be laoded

#### UIPreviewer.__openFile

__openFile()

Private slot to load a new file.

#### UIPreviewer.__print

__print(printer)

Private slot to the actual printing.

printer (QPrinter)
  reference to the printer object

#### UIPreviewer.__printImage

__printImage()

Private slot to handle the Print Image menu action.

#### UIPreviewer.__printPreviewImage

__printPreviewImage()

Private slot to handle the Print Preview menu action.

#### UIPreviewer.__saveImage

__saveImage()

Private slot to handle the Save Image menu action.

#### UIPreviewer.__updateActions

__updateActions()

Private slot to update the actions state.

#### UIPreviewer.__updateChildren

__updateChildren(sstyle)

Private slot to change the style of the show UI.

sstyle (str)
  name of the selected style

#### UIPreviewer.__whatsThis

__whatsThis()

Private slot called in to enter Whats This mode.

#### UIPreviewer.eventFilter

eventFilter(obj, ev)

Public method called to filter an event.

obj (QObject)
  object, that generated the event
ev (QEvent)
  the event, that was generated by object

Return:
  flag indicating if event was filtered out

Return Type:
  bool

#### UIPreviewer.show

show()

Public slot to show this dialog.

This overloaded slot loads a UI file to be previewed after the main window has been shown. This way, previewing a dialog doesn't interfere with showing the main window.

Up